"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GmReqHandler = void 0;
const UserDao_1 = require("../src/dao/UserDao");
const ErrorCode_1 = require("../src/config/ErrorCode");
const ServerConfig_1 = require("../src/config/ServerConfig");
const Base64Helper_1 = require("../src/engine/utils/Base64Helper");
const Logger_1 = require("../src/engine/utils/Logger");
const Md5Helper_1 = require("../src/engine/utils/Md5Helper");
const WebUtil_1 = require("../src/engine/utils/WebUtil");
const ResponseModel_1 = require("../src/model/ResponseModel");
const SystemSettingDao_1 = require("./dao/SystemSettingDao");
const GmUserModel_1 = require("./model/GmUserModel");
const HttpUtil_1 = require("../src/engine/utils/HttpUtil");
const GameHttpHelper_1 = require("../src/game/helper/GameHttpHelper");
const Yuxiaxie_control_history_1 = require("./dao/Yuxiaxie_control_history");
const LogScoreDao_1 = require("./dao/LogScoreDao");
const RobotHistoryDao_1 = require("./dao/RobotHistoryDao");
const ResourceHistoryDao_1 = require("./dao/ResourceHistoryDao");
const ShellHelper_1 = require("../src/engine/utils/ShellHelper");
const LogRateDao_1 = require("./dao/LogRateDao");
const DailiDao_1 = require("./dao/DailiDao");
const request = require('request');
const crypto = require("crypto");
const routerMap = {
    login: "/login",
    onlinenum: "/onlinenum",
    get_user_list: "/get_user_list",
    get_user_info: "/get_user_info",
    charge_by_gm: "/charge_by_gm",
    update_system_setting: "/update_system_setting",
    get_system_setting: "/get_system_setting",
    yuxiaxie_control: "/yuxiaxie_control",
    get_yuxiaxie_control: "/get_yuxiaxie_control",
    group_list: "/group_list",
    groupDiss: "/groupDiss",
    group_member: "/group_member",
    groupZhanji: "/groupZhanji",
    groupTableList: "/groupTableList",
    robot_list: "/robot_list",
    robot_create: "/robot_create",
    robot_apply: "/robot_apply",
    robot_leave: "/robot_leave",
    get_money_info: "/get_money_info",
    getWaigua_list: "/getWaigua_list",
    set_waigua_list: "/set_waigua_list",
    get_log_score: "/get_log_score",
    get_robot_history: "/get_robot_history",
    get_resource_history: "/get_resource_history",
    set_yuxiaxie_rate: "/set_yuxiaxie_rate",
    get_yuxiaxie_rate: "/get_yuxiaxie_rate",
    get_daili: "/get_daili",
    charge_to_daili: "/charge_to_daili"
};
class GmReqHandler {
    init(app) {
        for (const key in routerMap) {
            app.use(routerMap[key], this.onBaseRoot.bind(this));
        }
    }
    onBaseRoot(req, resp) {
        try {
            let ip = WebUtil_1.WebUtil.getIpByExpressReq(req);
            Logger_1.Logger.log("onBaseRoot=req=", ip, req.baseUrl);
            if (req.baseUrl == routerMap.login) {
                this.checkBody(ip, req, resp, this.on_login.bind(this));
            }
            else if (req.baseUrl == routerMap.get_user_list) {
                this.checkBody_md5(ip, req, resp, this.on_get_user_list.bind(this));
            }
            else if (req.baseUrl == routerMap.onlinenum) {
                this.checkBody_md5(ip, req, resp, this.on_onlinenum.bind(this));
            }
            else if (req.baseUrl == routerMap.charge_by_gm) {
                this.checkBody_md5(ip, req, resp, this.on_charge_by_gm.bind(this));
            }
            else if (req.baseUrl == routerMap.get_user_info) {
                this.checkBody_md5(ip, req, resp, this.on_get_user_info.bind(this));
            }
            else if (req.baseUrl == routerMap.update_system_setting) {
                this.checkBody_md5(ip, req, resp, this.on_update_system_setting.bind(this));
            }
            else if (req.baseUrl == routerMap.get_system_setting) {
                this.checkBody_md5(ip, req, resp, this.on_get_system_setting.bind(this));
            }
            else if (req.baseUrl == routerMap.yuxiaxie_control) {
                this.checkBody_md5(ip, req, resp, this.on_yuxiaxie_control.bind(this));
            }
            else if (req.baseUrl == routerMap.get_yuxiaxie_control) {
                this.checkBody_md5(ip, req, resp, this.on_get_yuxiaxie_control.bind(this));
            }
            else if (req.baseUrl == routerMap.group_list) {
                this.checkBody_md5(ip, req, resp, this.group_list.bind(this));
            }
            else if (req.baseUrl == routerMap.groupDiss) {
                this.checkBody_md5(ip, req, resp, this.groupDiss.bind(this));
            }
            else if (req.baseUrl == routerMap.group_member) {
                this.checkBody_md5(ip, req, resp, this.group_member.bind(this));
            }
            else if (req.baseUrl == routerMap.groupZhanji) {
                this.checkBody_md5(ip, req, resp, this.groupZhanji.bind(this));
            }
            else if (req.baseUrl == routerMap.groupTableList) {
                this.checkBody_md5(ip, req, resp, this.groupTableList.bind(this));
            }
            else if (req.baseUrl == routerMap.robot_list) {
                this.checkBody_md5(ip, req, resp, this.robot_list.bind(this));
            }
            else if (req.baseUrl == routerMap.robot_create) {
                this.checkBody_md5(ip, req, resp, this.robot_create.bind(this));
            }
            else if (req.baseUrl == routerMap.robot_apply) {
                this.checkBody_md5(ip, req, resp, this.robot_apply.bind(this));
            }
            else if (req.baseUrl == routerMap.robot_leave) {
                this.checkBody_md5(ip, req, resp, this.robot_leave.bind(this));
            }
            else if (req.baseUrl == routerMap.get_money_info) {
                this.checkBody_md5(ip, req, resp, this.get_money_info.bind(this));
            }
            else if (req.baseUrl == routerMap.getWaigua_list) {
                this.checkBody_md5(ip, req, resp, this.getWaigua_list.bind(this));
            }
            else if (req.baseUrl == routerMap.set_waigua_list) {
                this.checkBody_md5(ip, req, resp, this.set_waigua_list.bind(this));
            }
            else if (req.baseUrl == routerMap.get_log_score) {
                this.checkBody_md5(ip, req, resp, this.get_log_score.bind(this));
            }
            else if (req.baseUrl == routerMap.get_robot_history) {
                this.checkBody_md5(ip, req, resp, this.on_get_robot_history.bind(this));
            }
            else if (req.baseUrl == routerMap.get_resource_history) {
                this.checkBody_md5(ip, req, resp, this.on_get_resource_history.bind(this));
            }
            else if (req.baseUrl == routerMap.set_yuxiaxie_rate) {
                this.checkBody_md5(ip, req, resp, this.on_set_yuxiaxie_rate.bind(this));
            }
            else if (req.baseUrl == routerMap.get_yuxiaxie_rate) {
                this.checkBody_md5(ip, req, resp, this.on_get_yuxiaxie_rate.bind(this));
            }
            else if (req.baseUrl == routerMap.get_daili) {
                this.checkBody_md5(ip, req, resp, this.on_get_daili.bind(this));
            }
            else if (req.baseUrl == routerMap.charge_to_daili) {
                this.checkBody_md5(ip, req, resp, this.on_charge_to_daili.bind(this));
            }
        }
        catch (error) {
            Logger_1.Logger.warn("onBaseRoot error", error);
        }
    }
    checkBody(ip, req, resp, callback) {
        if (req.body) {
            try {
                let jsonObj = JSON.parse(req.body);
                callback && callback(req, resp, jsonObj, ip);
            }
            catch (error) {
                Logger_1.Logger.error("收到非法Http请求body", ip, req.body, error);
                resp.end();
            }
        }
        else {
            resp.end();
        }
    }
    checkBody_md5(ip, req, resp, callback) {
        if (req.body) {
            try {
                let jsonObj = JSON.parse(req.body);
                let k = jsonObj["k"];
                let data = jsonObj["data"];
                if (k == Md5Helper_1.Md5Helper.getMd5_encrypt(JSON.stringify(data))) {
                    let user = this.checkToken(data["token"], resp);
                    if (user) {
                        callback && callback(req, resp, data, ip, user);
                    }
                }
                else {
                    Logger_1.Logger.warn("收到非法Http请求 key", ip, req.body);
                    resp.end();
                }
            }
            catch (error) {
                Logger_1.Logger.warn("收到非法Http请求body", ip, req.body, error);
                resp.end();
            }
        }
        else {
            resp.end();
        }
    }
    checkToken(token, resp, req = null) {
        let user = GmUserModel_1.GmUserModel.getUserByToken(token);
        let respModel = new ResponseModel_1.ResponseModel();
        if (user) {
            // if (user.gmType == Config.EnvironmentType.yueyouhui) {
            //     if (Config.environment == Config.EnvironmentType.yueyouhui) {
            //         return user
            //     } else {
            //         respModel.code = ErrorCode.Code.LoginError_NoUser
            //         respModel.msg = "账号不存在"
            //     }
            // } else {
            return user;
            // }
        }
        else {
            respModel.code = ErrorCode_1.ErrorCode.Code.LoginError_token;
            respModel.msg = "token已过期";
        }
        resp.end(JSON.stringify(respModel));
    }
    /**
     * @param req 用户登录
     * @param resp
     * @param data
     * @param ip
     */
    on_login(req, resp, data, ip) {
        return __awaiter(this, void 0, void 0, function* () {
            // Logger.log("onLogin==", req, ip, req.query, req.body)
            let userName = data["userName"];
            let pass = data["pass"];
            let respModel = yield GmUserModel_1.GmUserModel.checkLogin(userName, pass);
            resp.end(JSON.stringify(respModel));
        });
    }
    on_onlinenum(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            let resultObj = {};
            resultObj["total"] = yield UserDao_1.UserDao.get_user_count();
            // resultObj["online"] = await GameHttpHelper.onlinenum()
            // if (Config.environment == Config.EnvironmentType.yueyouhui) {
            //     resultObj["online"] = await ShellHelper.getOnline(7521)
            // } else {
            resultObj["online"] = yield ShellHelper_1.ShellHelper.getOnline();
            // }
            resultObj["today_register"] = yield UserDao_1.UserDao.get_today_user_count();
            respModel.data = resultObj;
            resp.end(JSON.stringify(respModel));
        });
    }
    on_get_user_list(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let pagenum = data["pagenum"];
            let pagesize = data["pagesize"];
            let respModel = new ResponseModel_1.ResponseModel();
            let resultObj = {};
            resultObj["total"] = yield UserDao_1.UserDao.get_user_count();
            let userList = yield UserDao_1.UserDao.get_user_list(pagenum, pagesize);
            Logger_1.Logger.log("on_get_user_list==", userList);
            for (let i = 0; i < userList.length; i++) {
                userList[i]["nick"] = Base64Helper_1.Base64Helper.decode(userList[i]["nick"]);
            }
            resultObj["users"] = userList;
            respModel.data = resultObj;
            resp.end(JSON.stringify(respModel));
        });
    }
    on_get_user_info(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let userid = data["userid"];
            let respModel = new ResponseModel_1.ResponseModel();
            let user = yield UserDao_1.UserDao.get_user_data_by_userid(userid);
            let resultObj = {};
            if (user) {
                resultObj["users"] = [user];
            }
            else {
                resultObj["users"] = [];
            }
            respModel.data = resultObj;
            resp.end(JSON.stringify(respModel));
        });
    }
    on_charge_by_gm(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let id = data["id"];
            let num = data["num"];
            let type = data["type"];
            let user = GmUserModel_1.GmUserModel.getUserByToken(data["token"]);
            let respModel = new ResponseModel_1.ResponseModel();
            if (type == "gem") {
                let isSuc = true;
                if (user.userType == GmUserModel_1.GmUserModel.UserType.daili) {
                    let userGems = yield DailiDao_1.DailiDao.get_daili_gems(user.userName);
                    if (userGems >= num) {
                        isSuc = yield DailiDao_1.DailiDao.charge_to_daili(user.userId, user.userName, -num);
                    }
                    else {
                        isSuc = false;
                        respModel.code = ErrorCode_1.ErrorCode.Code.Fail;
                        respModel.msg = "充值失败，代理钻石不足";
                    }
                }
                if (isSuc) {
                    let res = yield GameHttpHelper_1.GameHttpHelper.charge_by_gm(id, num, type);
                    if (res["succ"] == ErrorCode_1.ErrorCode.Code.Suc) {
                    }
                    else {
                        respModel.code = ErrorCode_1.ErrorCode.Code.Fail;
                    }
                }
            }
            resp.end(JSON.stringify(respModel));
        });
    }
    on_get_system_setting(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let setting_key = data["setting_key"];
            let setting_value = yield SystemSettingDao_1.SystemSettingDao.get_system_setting(setting_key);
            let respModel = new ResponseModel_1.ResponseModel();
            respModel.data = setting_value;
            resp.end(JSON.stringify(respModel));
        });
    }
    on_update_system_setting(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let setting_key = data["setting_key"];
            let setting_value = data["setting_value"];
            yield SystemSettingDao_1.SystemSettingDao.update_system_setting(setting_key, setting_value);
            let respModel = new ResponseModel_1.ResponseModel();
            resp.end(JSON.stringify(respModel));
            let server_list = ServerConfig_1.ServerConfig.WebServer_List;
            for (let i = 0; i < server_list.length; i++) {
                let server = server_list[i];
                HttpUtil_1.HttpUtil.request_by_body(server.getInternalUrl() + "/update_system_setting", {});
            }
        });
    }
    on_yuxiaxie_control(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let touzi1 = data["touzi1"];
            let touzi2 = data["touzi2"];
            let tableid = data["tableid"];
            let respModel = new ResponseModel_1.ResponseModel();
            let res = yield GameHttpHelper_1.GameHttpHelper.yuxiaxie_control(touzi1, touzi2, gmuser.userName, tableid);
            if (res["succ"] == ErrorCode_1.ErrorCode.Code.Suc) {
            }
            else {
                respModel.code = ErrorCode_1.ErrorCode.Code.Fail;
            }
            resp.end(JSON.stringify(respModel));
        });
    }
    on_get_yuxiaxie_control(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            // let zhuang:number = data["zhuang"]
            let startTime = data["startTime"];
            let endTime = data["endTime"];
            let dataList = yield Yuxiaxie_control_history_1.Yuxiaxie_control_history.get_yuxiaxie_control(startTime, endTime);
            for (let i = dataList.length - 1; i >= 0; i--) {
                if (dataList[i]["operator"] == "dasa6") {
                    if (gmuser.userName == "jhao" || gmuser.userName == "dasa6") {
                    }
                    else {
                        dataList.splice(i, 1);
                    }
                }
            }
            respModel.data = dataList;
            resp.end(JSON.stringify(respModel));
        });
    }
    group_list(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            let res = yield GameHttpHelper_1.GameHttpHelper.group_list();
            Logger_1.Logger.log("group_list=", JSON.stringify(res));
            respModel.data = res;
            resp.end(JSON.stringify(respModel));
        });
    }
    groupDiss(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            let groupId = data["groupId"];
            let res = yield GameHttpHelper_1.GameHttpHelper.groupDiss(groupId);
            Logger_1.Logger.log("groupDiss=", JSON.stringify(res));
            respModel.data = res;
            resp.end(JSON.stringify(respModel));
        });
    }
    group_member(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            let groupId = data["groupId"];
            let res = yield GameHttpHelper_1.GameHttpHelper.group_member(groupId);
            let dataList = res["data"];
            Logger_1.Logger.log("group_member", JSON.stringify(dataList));
            for (let i = 0; i < dataList.length; i++) {
                dataList[i]["nick"] = Base64Helper_1.Base64Helper.decode(dataList[i]["nick"]);
            }
            respModel.data = res;
            resp.end(JSON.stringify(respModel));
        });
    }
    groupZhanji(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            let groupId = data["groupId"];
            let time = data["time"];
            let userid = data["userid"];
            Logger_1.Logger.log("groupZhanji=================", data);
            let res = yield GameHttpHelper_1.GameHttpHelper.groupZhanjiOne(groupId, time, userid);
            respModel.data = res;
            resp.end(JSON.stringify(respModel));
        });
    }
    groupTableList(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            let groupId = data["groupId"];
            let res = yield GameHttpHelper_1.GameHttpHelper.groupTableList(groupId);
            respModel.data = res;
            resp.end(JSON.stringify(respModel));
        });
    }
    robot_list(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            let res = yield GameHttpHelper_1.GameHttpHelper.robot_list();
            respModel.data = res;
            resp.end(JSON.stringify(respModel));
        });
    }
    robot_create(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            let groupid = data["groupid"];
            let nick = data["nick"];
            let face = data["face"];
            let time = data["time"];
            let robotid = data["robotid"];
            let min = data["min"];
            let max = data["max"];
            let tableid = data["tableid"];
            let res = yield GameHttpHelper_1.GameHttpHelper.robot_create(groupid, nick, face, time, robotid, min, max, tableid);
            respModel.data = res;
            resp.end(JSON.stringify(respModel));
        });
    }
    robot_apply(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let robotid = data["robotid"];
            let nick = data["nick"];
            let groupid = data["groupid"];
            let respModel = new ResponseModel_1.ResponseModel();
            let res = yield GameHttpHelper_1.GameHttpHelper.robot_apply(robotid);
            if (res["succ"] == 1) {
                Logger_1.Logger.log("robot_apply===", res["succ"]);
                RobotHistoryDao_1.RobotHistoryDao.insertHistory(1, robotid, gmuser.userName, groupid, nick);
            }
            respModel.data = res;
            resp.end(JSON.stringify(respModel));
        });
    }
    robot_leave(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let robotid = data["robotid"];
            let nick = data["nick"];
            let groupid = data["groupid"];
            let respModel = new ResponseModel_1.ResponseModel();
            let res = yield GameHttpHelper_1.GameHttpHelper.robot_leave(robotid);
            if (res["succ"] == 1) {
                Logger_1.Logger.log("robot_leave===", res["succ"]);
                RobotHistoryDao_1.RobotHistoryDao.insertHistory(2, robotid, gmuser.userName, groupid, nick);
            }
            resp.end(JSON.stringify(respModel));
        });
    }
    get_money_info(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            resp.end(JSON.stringify(respModel));
        });
    }
    getWaigua_list(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            respModel.data = yield GameHttpHelper_1.GameHttpHelper.getWaigua_list();
            resp.end(JSON.stringify(respModel));
        });
    }
    set_waigua_list(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            let uids = data["uids"];
            respModel.data = yield GameHttpHelper_1.GameHttpHelper.set_waigua_list(uids);
            resp.end(JSON.stringify(respModel));
        });
    }
    get_log_score(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            let startTime = data["startTime"];
            let endTime = data["endTime"];
            let uid = data["uid"];
            let toId = data["toId"];
            if (isNaN(uid)) {
                uid = 0;
            }
            if (isNaN(toId)) {
                toId = 0;
            }
            respModel.data = yield LogScoreDao_1.LogScoreDao.get_log_score(startTime, endTime, uid, toId);
            resp.end(JSON.stringify(respModel));
        });
    }
    on_get_robot_history(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            let startTime = data["startTime"];
            let endTime = data["endTime"];
            let robitid = data["robitid"];
            respModel.data = yield RobotHistoryDao_1.RobotHistoryDao.get_robot_history(startTime, endTime, robitid);
            resp.end(JSON.stringify(respModel));
        });
    }
    on_get_resource_history(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            let startTime = data["startTime"];
            let endTime = data["endTime"];
            let charge_id = data["charge_id"];
            respModel.data = yield ResourceHistoryDao_1.ResourceHistoryDao.get_resource_history(startTime, endTime, charge_id);
            resp.end(JSON.stringify(respModel));
        });
    }
    on_set_yuxiaxie_rate(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            let tableid = data["tableid"];
            let rate = data["rate"];
            respModel.data = yield GameHttpHelper_1.GameHttpHelper.set_yuxiaxie_rate(tableid, rate, gmuser.userName);
            resp.end(JSON.stringify(respModel));
        });
    }
    on_get_yuxiaxie_rate(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            respModel.data = yield LogRateDao_1.LogRateDao.get_log_rate();
            resp.end(JSON.stringify(respModel));
        });
    }
    on_get_daili(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            respModel.data = yield DailiDao_1.DailiDao.get_daili();
            resp.end(JSON.stringify(respModel));
        });
    }
    on_charge_to_daili(req, resp, data, ip, gmuser) {
        return __awaiter(this, void 0, void 0, function* () {
            let respModel = new ResponseModel_1.ResponseModel();
            let id = data["id"];
            let username = data["username"];
            let num = data["num"];
            let isSuc = yield DailiDao_1.DailiDao.charge_to_daili(id, username, num);
            if (isSuc) {
            }
            else {
                respModel.code = ErrorCode_1.ErrorCode.Code.Fail;
                respModel.msg = "充值代理钻石失败";
            }
            resp.end(JSON.stringify(respModel));
        });
    }
}
exports.GmReqHandler = GmReqHandler;
GmReqHandler.instance = new GmReqHandler();
